var config_base_url = '';
var requestTimeOut = 150000;

function _POST(url,data,async,type,postType) {
		return {
			then: function (cb,failCb) {
				$.ajax({
					url: url,
					type: type?type:'POST',
					async:async?async:true,
					data: data,
					dataType: postType?postType:"json",
					headers: {
						'Content-Type': (postType && postType === 'json')
							? 'application/json;charset=UTF-8'
							: 'application/x-www-form-urlencoded'
					},
					timeout: requestTimeOut,
					success: function (res) {
						// if (cb) {
							if (res.code === 0) {//操作成功
								cb&&cb(res);
							}else{
								if(failCb){
									failCb(res)
								}else{
									// popup.tips(res.msg,1000);
									window.parent.indexTips(res.msg)
								}
								
							 }
						// }
					},
					error: function (err) {
						alert('系统出错啦');
					}
				});
			}
	    };
}
